﻿<TreeView
     xmlns:c="clr-namespace:TagFlo"
	xmlns:v="clr-namespace:TagFlo.Views"

    x:Class="TagFlo.Views.SelectionPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    ScrollViewer.CanContentScroll="True" 
    VerticalContentAlignment="Stretch" 
    Padding="0,1,1,1" Margin="0,0,0,0" Focusable="False" 
	 >

    <TreeView.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\Resources\ResourceDictionary.xaml"/>
                <ResourceDictionary Source="..\Resources\ControlStyle.xaml"/>
                <ResourceDictionary Source="..\Themes\current.theme.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <c:PathConverter x:Key="PathConverter"/>
            <c:ExposureModeConverter x:Key="ExposureModeConverter"/>
            <c:CameraModelConverter x:Key="CameraModelConverter"/>
            <c:FocalLengthConverter x:Key="FocalLengthConverter"/>
            <c:LensApertureConverter x:Key="LensApertureConverter"/>
            <c:ExposureTimeConverter x:Key="ExposureTimeConverter"/>
            <c:WhiteBalanceConverter x:Key="WhiteBalanceConverter"/>
            <c:RatingConverter x:Key="RatingConverter"/>
            <c:IsoSpeedConverter x:Key="IsoSpeedConverter"/>

            <HierarchicalDataTemplate DataType="{x:Type v:YearGroup}" ItemsSource="{Binding Path=MonthGroups}" >
               <DockPanel>
                    <Image Source="/TagFlo;component/Icons/calendar_view_week.png" Margin="0,0,5,0" />
                    <TextBlock Text="{Binding Path=Year}" Foreground="Blue"/>
                </DockPanel>
                
                
            </HierarchicalDataTemplate>

            <HierarchicalDataTemplate DataType="{x:Type v:MonthGroup}" ItemsSource="{Binding Path=Dates}">
                <DockPanel>
                    <Image Source="/TagFlo;component/Icons/calendar_view_month.png" Margin="0,0,5,0" />
                    <TextBlock Text="{Binding Path=Month}" Foreground="Blue"/>
                </DockPanel>
            </HierarchicalDataTemplate>

            <DataTemplate x:Key="IsoSpeedTemplate">
                <TextBlock Text="{Binding Converter={StaticResource IsoSpeedConverter}}"/>
            </DataTemplate>

            <DataTemplate x:Key="ExposureTimeTemplate">
                <TextBlock Text="{Binding Converter={StaticResource ExposureTimeConverter}}"/>
            </DataTemplate>

            <DataTemplate x:Key="CameraModelTemplate">
                <TextBlock Text="{Binding Converter={StaticResource CameraModelConverter}}"/>
            </DataTemplate>


            <DataTemplate x:Key="FocalLengthTemplate">
                <TextBlock Text="{Binding Converter={StaticResource FocalLengthConverter}}"/>
            </DataTemplate>

            <DataTemplate x:Key="LensApertureTemplate">
                <TextBlock Text="{Binding Converter={StaticResource LensApertureConverter}}"/>
            </DataTemplate>

            <DataTemplate x:Key="RatingTemplate">
                <TextBlock Text="{Binding Converter={StaticResource RatingConverter}}"/>
            </DataTemplate>


            <DataTemplate x:Key="DayTemplate">
                <DockPanel>
                    <Image Source="/TagFlo;component/Icons/calendar_view_day.png" Margin="0,0,5,0" />

                    <TextBlock Text="{Binding Path=Day}" Foreground="Blue"/>
                </DockPanel>
            </DataTemplate>

            <HierarchicalDataTemplate x:Key="MonthTemplate"
		ItemTemplate ="{StaticResource DayTemplate}"
		ItemsSource = "{Binding Path=DayToMonth}">
                <DockPanel>
                    <Image Source="/TagFlo;component/Icons/calendar_view_month.png" Margin="0,0,5,0" />

                    <TextBlock Text="{Binding Path=Month}" Foreground="Blue"/>
                </DockPanel>
            </HierarchicalDataTemplate>

            <HierarchicalDataTemplate   x:Key="DateTagTreeTemplate"
		ItemTemplate ="{StaticResource MonthTemplate}"
		ItemsSource = "{Binding Path=MonthToYear}">
                <DockPanel>
                    <Image Source="/TagFlo;component/Icons/calendar_view_week.png" Margin="0,0,5,0" />
                    <TextBlock Text="{Binding Path=Year}" Foreground="Blue"/>
                </DockPanel>
            </HierarchicalDataTemplate>
        </ResourceDictionary>


    </TreeView.Resources>

    <TreeViewItem
					Header="All Photos"
					x:Name="AllPhotosTreeViewItem" FontWeight="Bold" MouseUp="AllPhotosSelected" Selected="AllPhotosSelected"  >

    </TreeViewItem>
    <!--ItemTemplate="{StaticResource DateTagTreeTemplate}"-->
    <TreeViewItem
        
					ItemsSource="{Binding }"
					x:Name="DateTreeViewItem" >
        <TreeViewItem.Header>
            <DockPanel>
                <Image Source="/TagFlo;component/Icons/calendar_view_month.png" Margin="0,0,3,0" />
                <TextBlock Text="Date" />
            </DockPanel>
        </TreeViewItem.Header>
    </TreeViewItem>
    <TreeViewItem x:Name="PathTreeViewItem" >
        <TreeViewItem.Header>
            <DockPanel>
                <Image Source="/TagFlo;component/Icons/folder.png" Margin="0,0,3,0" />
                <TextBlock Text="Folders" />
            </DockPanel>
        </TreeViewItem.Header>
        <TreeViewItem.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding Path=Childs}">
                <TextBlock Text="{Binding Converter={StaticResource PathConverter}}"></TextBlock>
     
            
        </HierarchicalDataTemplate>
    </TreeViewItem.ItemTemplate>
        </TreeViewItem>
</TreeView>
    

